import { ElMessage } from 'element-plus'
import { reactive } from 'vue';

// 弹出提示封装

const data = reactive({
  message: '',
  type: ''
})

const showMessage = (res) => {
  if (res.msgType == 8000) {
    data.message = res.msg;
    data.type = 'success';
  } else {
    data.message = res.msg;
    data.type = 'warning';
  }
  ElMessage({
    showClose: true,
    message: data.message,
    center: true,
    type: data.type,
  });
}

export default showMessage